package com.zhangbo.myapplication.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.zhangbo.myapplication.R;
import com.zhangbo.myapplication.bean.UserManger;
import com.zhangbo.myapplication.util.MyUtil;

public class MainActivity extends AppCompatActivity {

    private static final String Tag = MainActivity.class.getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        setTitle(Tag);

        TextView to_SecondActivity = (TextView) findViewById(R.id.to_second_activity);
        to_SecondActivity.setText(MyUtil.getString());
        to_SecondActivity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, SecondActivity.class);
                startActivity(intent);
            }
        });

        TextView to_messenger_activity = (TextView) findViewById(R.id.to_messenger_activity);
        to_messenger_activity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, MessengerActivity.class);
                startActivity(intent);
            }
        });

        TextView to_book_manager_activity = (TextView) findViewById(R.id.to_book_manager_activity);
        to_book_manager_activity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, BookManagerActivity.class);
                startActivity(intent);
            }
        });


        UserManger.sUserId = 2;
        Log.e(Tag, "UserManger.sUserId = " + UserManger.sUserId);
        Log.e(Tag, "UserManger = " + UserManger.class);
    }
}
